home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19950528-19950726
/
000377_news@columbia.edu_Mon Jul 17 17:19:44 1995.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
2KB
Received: from apakabar.cc.columbia.edu by watsun.cc.columbia.edu with SMTP id AA23786
(5.65c+CU/IDA-1.4.4/HLK for <kermit.misc@watsun.cc.columbia.edu>); Mon, 17 Jul 1995 14:53:27 -0400
Received: by apakabar.cc.columbia.edu id AA15422
(5.65c+CU/IDA-1.4.4/HLK for kermit.misc@watsun); Mon, 17 Jul 1995 14:53:26 -0400
Path: news.columbia.edu!panix!news.mathworks.com!uunet!in1.uu.net!news3.digex.net!digex.net!not-for-mail
From: hashmi@cnj.digex.net (Atiqullah Hashmi)
Newsgroups: comp.unix.programmer,comp.protocols.kermit.misc
Subject: dialing program; modem receives dialstring but doesn't dial?
Date: 17 Jul 1995 13:19:44 -0400
Organization: Express Access Online Communications, New Jersey, USA
Lines: 41
Message-Id: <3ue63g$g3n@cnj.digex.net>
Nntp-Posting-Host: cnj.digex.net
Xref: news.columbia.edu comp.unix.programmer:32354 comp.protocols.kermit.misc:3213
Apparently-To: kermit.misc@watsun.cc.columbia.edu
Hi,
I have a simple program to dial out via a hayes modem. When run, the
modem RD and TD lights blink showing that it receives the dial string
from the program but doesn't really dial out.
Here is the relevant piece of code. Any help is appreciated.
Thanks
Atiq
-------------------------------------
void sttyModem(int fd)
{
struct termio tbuf;
if (ioctl(fd, TCGETA, &tbuf) < 0 )
cerr << "ioctl(TCGETA) failed; errno = "<< errno << endl;
tbuf.c_iflag = IXON | IXOFF | ISTRIP | IGNBRK | IGNPAR;
tbuf.c_oflag = 0;
tbuf.c_lflag = 0;
tbuf.c_cflag = B300 | CS7 | CREAD | HUPCL | PARENB;
tbuf.c_cc[4] = 1; // MIN
tbuf.c_cc[5] = 0; // TIME
if (ioctl(fd, TCSETAF, &tbuf))
cerr << "ioctl(TCSETAF) failed; errno = "<< errno << endl;
}
main()
{
int tty_fd;
tty_fd=open(....) etc.
sttyModem(tty_fd);
char *str="ATDT91(800)222-3333\r"; //some number
char ss[10];
write(tty_fd, str, strlen(str));
read(tty_fd, ss, 1);
// other code..........
exit(0);
}